<?php
declare (strict_types=1);

namespace app\api\controller;

use app\common\model\Config;
use think\facade\Cache;
use think\facade\View;

class Protocol extends Base
{

    public function index()
    {
        $name = $this->request->get('name');

        $config = Config::where('name', $name)->field('title,value')->find();
        View::assign([
            'config' => $config,
        ]);
        return View::fetch();
    }

    /** 隐私协议
     * @return string
     */
    public function privacy()
    {
        View::assign([
            'title' => '隐私协议',
            'content' => Cache::get('system')['privacy_agreement'],
            'is_mobile' => is_mobile()
        ]);
        return View::fetch();
    }

}
